statusdict /setpageparams known
{statusdict begin
  *W *H 0 1
  4 -1 roll
  statusdict /measure known
  {measure 2 copy ge {exch}if pop}if
  4 1 roll
 setpageparams
 end
}if
